<% include ../common/header.ejs %>
</head>
<body>
    <% include ../common/nav.ejs %>
    <div class="container">
        <div class="row">
            <% include ../common/sidebar.ejs %>
            <div class="col-md-10">
                
                <ol class="breadcrumb">
                    <li><a href="#">Home</a></li>
                    <li><a href="#">栏目管理</a></li>
                </ol>

                <form class="form-inline" action="/admin/category/add" method="post">
                    <div class="form-group">
                        <label class="sr-only" for="exampleInputEmail3">栏目名</label>
                        <input type="text" name="cname" class="form-control" id="exampleInputEmail3" placeholder="栏目名">
                    </div>
                    
                    <div class="checkbox">
                        <label>
                            <input type="checkbox" name="active" value="1"> 是否显示
                        </label>
                    </div>
                    <button type="submit" class="btn btn-default">添加</button>
                </form>

                <table class="table table-hover">
                    <thead>
                        <th>cid</th>
                        <th>栏目名</th>
                        <th>是否显示</th>
                        <th>操作</th>
                    </thead>
                    <tbody>
                        <% for(var i=0;i<categories.length;i++){ %>
                            <tr>
                                <td><%= categories[i].cid %></td>
                                <td><%= categories[i].cname %></td>
                                <td><% if(categories[i].active==1) { %> 是  <% }else{ %> 否 <% } %></td>
                                <td>
                                    <a href="">编辑</a>
                                    <a href="">删除</a>
                                    <a href="">添加文章</a>
                                </td>
                            </tr>
                        <% } %>
                    </tbody>
                </table>

            </div>
        </div>
    </div>

<% include ../common/footer.ejs %>